ChatFrame1:AddMessage("\124cFF1987FFHex\124cFFFFFFFFInterrupt Loaded.")
-- Start of Settings --
local sIraid = true;
local sIparty = true;
local sIsay = false;
--- End of Settings ---

-----------------------
function ShowSpellLink(spellID)
	local spellLink = GetSpellLink(spellID or 0) or "<no spellLink found>";
	DEFAULT_CHAT_FRAME:AddMessage(spellLink);
end
------ Start

local function OnEvent(self, event, ...)
	if ( event == "PLAYER_LOGIN" ) then
		self:UnregisterEvent("PLAYER_LOGIN");
		self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
	elseif ( event == "COMBAT_LOG_EVENT_UNFILTERED" ) then
		local dumpClass, playerClass = UnitClass("player");
		local ZoneName = GetRealZoneText();
		local numParty	= GetNumPartyMembers();
		if (ZoneName == "Tol Barad") or (ZoneName == "Wintergrasp") or (ZoneName == "Alterac Vally") or (ZoneName == "Arathi Basin") or (ZoneName == "Eye of the Storm") or (ZoneName == "Isle of Conquest") or (ZoneName == "Strand of the Ancients") or (ZoneName == "The Battle for Gilneas") or (ZoneName == "Twin Peaks") or (ZoneName == "Warsong Gulch") then
		else
			local timestamp, eventType, sourceGUID, sourceName, sourceFlags, destGUID, destName, destFlags, spellID, spellName, _, extraskillID, extraskillname = ...;
			if (eventType == "SPELL_INTERRUPT") and sourceName == UnitName("player") then
				intmsg = ("\124cFF1987FFInterrupted\124cFFFFFFFF "..destName.."'s "  ..GetSpellLink(extraskillID).. " with " ..GetSpellLink(spellID)..".")
				if UnitInRaid("player") and (sIraid == true) then
					SendChatMessage(intmsg, "RAID")
				elseif UnitInParty("player") and (sIparty == true) and (numParty > 0) then
					SendChatMessage(intmsg, "PARTY")
				elseif (sIsay == true) then
					SendChatMessage(intmsg, "SAY")
				end
			elseif (eventType == "SPELL_STOLEN") and sourceName == UnitName("player") then
				intmsg = (""..GetSpellLink(spellID).."'d " ..destName.. "'s "  ..GetSpellLink(extraskillID).. ".")
				if UnitInRaid("player") and (sIraid == true) then
					SendChatMessage(intmsg, "RAID")
				elseif UnitInParty("player") and (sIparty == true) and (numParty > 0) then
					SendChatMessage(intmsg, "PARTY")
				elseif (sIsay == true) then
					SendChatMessage(intmsg, "SAY")
				end
			end
		end
	end;
end
local HexInterrupt = CreateFrame("Frame")
HexInterrupt:RegisterEvent("PLAYER_LOGIN")
HexInterrupt:SetScript("OnEvent", OnEvent)